String[] adj;

void clueSetup() {
  adj = loadStrings("adj.txt");
}

String adjPull(String elements)
{
  String[] formula = split(elements, ":");
  String[] intermed;
  int[] elementIDs = int(formula);
  char search1 = ' ';
  char search2 = ' ';
  String full = "";
  
  for(int i = 0; i < elementIDs.length; i++)
  {
    String mid = "";
      
    switch(elementIDs[i]) {
      case 0: search1 = 'c';
        search2 = 'a';
        break;
      case 1: search1 = 'c';
        search2 = 'a';
        break;
      case 2: search1 = 'f';
        search2 = 'i';
        break;
      case 3: search1 = 'h';
        search2 = 'e';
        break;
      case 4: search1 = 'h';
        search2 = 'y';
        break;
      case 5: search1 = 'i';
        search2 = 'c';
        break;
      case 6: search1 = 's';
        search2 = 'i';
        break;
      case 7: search1 = 's';
        search2 = 'o';
        break;
      case 8: search1 = 's';
        search2 = 'u';
        break;
      case 9: search1 = 't';
        search2 = 'i';
        break;
    }
    
      for(int j = 0; j < adj.length;j++)
      { 
        if(adj[j].charAt(0) == search1 && adj[j].charAt(1) == search2)
        {
          mid = mid + adj[j] + ",";
        }
      }
      
      intermed = split(mid, ",");
      int pick = (int)random(0,intermed.length);
      full = full + intermed[pick] + " ";
  }
  
  return full;
}


